import { base } from '@/config'
import http from '@/utils/request'

// 广告列表
const advertApi = {
  // 添加
  addAdvert: params => {
    return http.postJson(`${base.advert}/banner/add`, params)
  },
  // 修改
  updateAdvert: params => {
    return http.postJson(`${base.advert}/banner/edit`, params)
  },
  // 删除
  deleteAdvert: id => {
    return http.postJson(`${base.advert}/banner/remove/${id}`)
  },
  // 显示，隐藏
  updateStatus: params => {
    return http.postJson(`${base.advert}/banner/edit/isShow`, params)
  },
  // 获取列表
  getAdvertList: params => {
    return http.get(`${base.advert}/banner/list`, params)
  },
  // 获取详情
  getAdvertDetail: id => {
    return http.get(`${base.advert}/banner/${id}`)
  }
}

export default advertApi
